#include <iostream>
using namespace std;

class A {
public:
    A() {
        cout << "A start..." << endl;
    }
    virtual ~A() {
        cout << "A finished" << endl;
    }
    void func1() {
        cout << "A::func1()" << endl;
    }

    virtual void func2() {
        cout << "A::func2()" << endl;
    }
};

class B: public A {
public:
    B() {
        cout << "B start..." << endl;
    }
    ~B() {
        cout << "B finished" << endl;
    }
    void func1() {
        cout << "B::func1()" << endl;
    }

    void func2() {
        cout << "B::func2()" << endl;
    }
};

int main(int argc, char *argv[])
{
    A *pa = new B();
    pa->func1();
    pa->func2();
    delete pa;
    return 0;
}
